package com.example.demodb.repository;

import com.example.demodb.entity.Song;
import com.example.demodb.entity.SongSong;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface ISongSongRepository extends JpaRepository<SongSong, Long> {

//    @Modifying
//    @Query("update TodoItem todo "
//            +"set todo.isDone=?2 "
//            +"where todo.id=?1 "
//    )
//    public void update(Long id, Boolean isDone);

    @Transactional
    void deleteById(Long id);

    SongSong findSongSongById(Long id);

    SongSong findSongSongBySong1AndSong2(Song song1, Song song2);

    SongSong findSongSongBySong2AndSong1(Song song2, Song song1);

    List<SongSong> findAllSongSongBySong1(Song song1);
    List<SongSong> findAllSongSongBySong2(Song song2);


}
